package cn.doit.scala.day05.high_function

/**
 * @DATE 2021/12/30/15:44
 * @Author MDK
 * @Version 2021.2.2
 * */
class Student(val sid:Int, val name:String) {

}
object Student{
  //封装数据
  def apply(sid:Int, name:String): Student =new Student(sid, name)
  //解析数据  some取值
  def unapply(args:Student):Option[(Int,String)]={
    new Some[(Int, String)](args.sid, args.name)
  }
}